//
//  DCWebView.h
//  DCUtilKit
//
//  Created by zhangtao on 2020/10/9.
//  Copyright © 2020 zhangtao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
#import "DCWebViewDelegate.h"
#import "WKWebViewJavascriptBridge.h"

NS_ASSUME_NONNULL_BEGIN

@interface DCWebView : UIViewController<WKNavigationDelegate>

@property(nonatomic,strong) WKWebView *dcWebView;
@property(nonatomic,weak) id<DCWebViewDelegate> dcWebViewDelegate;
@property(nonatomic,strong) WKWebViewJavascriptBridge *bridge;
@property(nonatomic,strong) WVJBResponseCallback handlerResponseCallback;
@property(nonatomic,strong) UIViewController *webViewParentViewController;

- (instancetype) initWithUrl:(NSString*)url messgeHandlerName:(NSString*)messgeHandlerName messageInfo:(NSDictionary* __nullable)messageInfo;

- (void) presentView:(UIViewController*)parentViewController;

- (void) dismissView;

- (void) sendMessageToWeb:(NSDictionary*)data;

- (void) sendMessageToWeb:(NSDictionary*)data responseCallback:(id)responseCallback;

- (void) sendMessageToWeb:(NSString*)handlerName data:(NSDictionary*)data;

@end

NS_ASSUME_NONNULL_END
